﻿<script type="text/javascript">
    $(function () {
        $("#divGocsId").html('<input type="hidden" id="GocsId" name="GocsId" /> <input type="hidden" id="ruleIdException" name="ruleIdException" /> ');
        $("#divRuleName").hide();

        $("#existingRule, #newRule").change(function () {
            if ($("#existingRule").is(":checked")) {
                $("#divExistingRule").show();
                $("#divNewRule").hide();
            }
            else {
                $("#RuleId").val('');
                $("#divExistingRule").hide();
                $("#divNewRule").show();
            }
        });

        $("#fieldsetRuleCondition").hide();
    });

</script>
<div style="height: 30px;">
    <input type="radio" name="rule" id="existingRule" checked="checked" />Select an
    existing rule &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    <input type="radio" name="rule" id="newRule" />Create a new rule
</div>
<div id="divExistingRule">
    @Html.DropDownList("RuleId", (IEnumerable<SelectListItem>)ViewBag.Rules, "Select a rule")
</div>
<div id="divNewRule" style="display: none;">
    @Html.Action("Form", "Rule")
</div>
